package com.dmall.scf.utils;

import org.apache.commons.lang3.StringUtils;

/**
 * Created by yzm on 2019/6/5.
 * 时间类型
 */
public enum DateTimeType {
    MINUTE, HOUR, DAY, WEEK, MONTH, YEAR;

    public static DateTimeType getDateTimeType(String val) {
        if (StringUtils.isBlank(val)) {
            return null;
        }
        DateTimeType[] dty = DateTimeType.values();
        for (DateTimeType d : dty) {
            if (d.name().equals(val.toUpperCase())) {
                return d;
            }
        }
        return null;
    }
}
